package com.netflix;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
public class SpringcloudNetflixRibbonProviderApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringcloudNetflixRibbonProviderApplication.class, args);
    }

    @RestController
    static class TestController{

        private Logger logger=LoggerFactory.getLogger(TestController.class);

        @Value("${server.port}")
        private String port;

        @GetMapping("/test")
        public String test(String name) throws Exception{
            Thread.sleep(100L);
            logger.info("test方法被调用");
            return port+"-provider:"+name;
        }
    }

}
